package com.broada.apm.dao;

import java.util.List;

import com.broada.apm.model.Resource;

public interface ResourceDao {

	/**
	 * 添加资源
	 * @param resource
	 */
	public void addResource(Resource resource);
	
	/**
	 * 更新资源
	 * @param resource
	 */
//	public void updateResource(Resource resource);
	
	/**
	 * 删除资源
	 * @param resource
	 */
	public void deleteResource(Resource resource);
	
	/**
	 * 根据资源id查询
	 * @param resId
	 * @return
	 */
	public Resource getResourceById(String resId);
	
	/**
	 * 根据业务系统id查询资源
	 * @param appId
	 * @return
	 */
	public List<Resource> getResourcesByAppId(Resource resource);

	/**
	 * 分页查询资源 pageSize(-1=all)
	 * @param pageIndex
	 * @param pageSize
	 * @return
	 */
	public List<Resource> getAllResources();
	
	/**
	 * 查询关键交易
	 * @param resource
	 * @return
	 */
	public List<Resource> getResourcesByCondition(Resource resource);

	/**
	 * 根据关键交易名称获取关键交易
	 * @param txName
	 * @return
	 */
	public List<Resource> getResourceByName(String txName);

	public List<Resource> getResourceByIds(List<String> resourceIds);

	public void addKeyResource(Resource resource);

	public void updateKeyResource(Resource resource);

	public Resource getKeyResourceById(String id);

	public List<Resource> getKeyResourcesByCondition(Resource resource);

	public List<Resource> getKeyResourceByIds(List<String> resIds);

	public List<Resource> getKeyResourcesByAppId(Resource res);

	public List<Resource> getKeyResourceByUri(String txName, String appId, String serviceId);

	public List<String> getKeyResourceIdsByCondition(Resource resource);

	public List<Resource> getResourcesByKeyWord(Resource resource);
}
